import 'package:FiduMart/generated/json/base/json_convert_content.dart';
import 'package:FiduMart/core/network/model/icon_entity.dart';

IconEntity $IconEntityFromJson(Map<String, dynamic> json) {
  final IconEntity iconEntity = IconEntity();
  final int? id = jsonConvert.convert<int>(json['id']);
  if (id != null) {
    iconEntity.id = id;
  }
  final String? picture = jsonConvert.convert<String>(json['picture']);
  if (picture != null) {
    iconEntity.picture = picture;
  }
  final String? address = jsonConvert.convert<String>(json['address']);
  if (address != null) {
    iconEntity.address = address;
  }
  final int? type = jsonConvert.convert<int>(json['type']);
  if (type != null) {
    iconEntity.type = type;
  }
  final String? iconNamezh = jsonConvert.convert<String>(json['icon_nameZh']);
  if (iconNamezh != null) {
    iconEntity.iconNamezh = iconNamezh;
  }
  final String? iconNameen = jsonConvert.convert<String>(json['icon_nameEn']);
  if (iconNameen != null) {
    iconEntity.iconNameen = iconNameen;
  }
  final String? iconNametha = jsonConvert.convert<String>(json['icon_nameTha']);
  if (iconNametha != null) {
    iconEntity.iconNametha = iconNametha;
  }
  final String? jiaoNamezh = jsonConvert.convert<String>(json['jiao_nameZh']);
  if (jiaoNamezh != null) {
    iconEntity.jiaoNamezh = jiaoNamezh;
  }
  final String? jiaoNameen = jsonConvert.convert<String>(json['jiao_nameEn']);
  if (jiaoNameen != null) {
    iconEntity.jiaoNameen = jiaoNameen;
  }
  final String? jiaoNametha = jsonConvert.convert<String>(json['jiao_nameTha']);
  if (jiaoNametha != null) {
    iconEntity.jiaoNametha = jiaoNametha;
  }
  final String? arName = jsonConvert.convert<String>(json['AR_name']);
  if (arName != null) {
    iconEntity.arName = arName;
  }
  final int? titledisplay = jsonConvert.convert<int>(json['titledisplay']);
  if (titledisplay != null) {
    iconEntity.titledisplay = titledisplay;
  }
  return iconEntity;
}

Map<String, dynamic> $IconEntityToJson(IconEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['id'] = entity.id;
  data['picture'] = entity.picture;
  data['address'] = entity.address;
  data['type'] = entity.type;
  data['icon_nameZh'] = entity.iconNamezh;
  data['icon_nameEn'] = entity.iconNameen;
  data['icon_nameTha'] = entity.iconNametha;
  data['jiao_nameZh'] = entity.jiaoNamezh;
  data['jiao_nameEn'] = entity.jiaoNameen;
  data['jiao_nameTha'] = entity.jiaoNametha;
  data['AR_name'] = entity.arName;
  data['titledisplay'] = entity.titledisplay;
  return data;
}

extension IconEntityExt on IconEntity {
  IconEntity copyWith({
    int? id,
    String? picture,
    String? address,
    int? type,
    String? iconNamezh,
    String? iconNameen,
    String? iconNametha,
    String? jiaoNamezh,
    String? jiaoNameen,
    String? jiaoNametha,
    String? arName,
    int? titledisplay,
  }) {
    return IconEntity()
      ..id = id ?? this.id
      ..picture = picture ?? this.picture
      ..address = address ?? this.address
      ..type = type ?? this.type
      ..iconNamezh = iconNamezh ?? this.iconNamezh
      ..iconNameen = iconNameen ?? this.iconNameen
      ..iconNametha = iconNametha ?? this.iconNametha
      ..jiaoNamezh = jiaoNamezh ?? this.jiaoNamezh
      ..jiaoNameen = jiaoNameen ?? this.jiaoNameen
      ..jiaoNametha = jiaoNametha ?? this.jiaoNametha
      ..arName = arName ?? this.arName
      ..titledisplay = titledisplay ?? this.titledisplay;
  }
}